#ifndef XMLPARSER_H
#define XMLPARSER_H


#include <QFile>
#include <QtXml/QDomDocument>
#include <QHash>
#include <QVector>
#include <GL/gl.h>
#include <GL/glu.h>
#include <GL/glut.h>
#include <QGLWidget>
#include <QVector3D>
#include <QImage>

class XMLParser:public QGLWidget
{

public:
    XMLParser();
    void parse();
    GLuint getObject();
    GLuint getlights(){return lights;}
    QHash<int,QString> getIds(){return ids;}
    QHash<QString,GLuint> getonclick(){return onclick;}
    float getStartX(){return startx;}
    float getStartY(){return starty;}
    float getStartZ(){return startz;}
    float getMinX(){return minx;}
    float getMinY(){return miny;}
    float getMinZ(){return minz;}
    float getMaxX(){return maxx;}
    float getMaxY(){return maxy;}
    float getMaxZ(){return maxz;}
private :

    float startx,starty,startz;
    float minx,maxx,miny,maxy,minz,maxz;

    QHash<QString,GLuint> onclick;
    QHash<QString,GLuint> lists;
    QHash<int,QString> ids;
    QHash<QString ,QVector<float> > points;
    void setVariables(QDomNode node);
    void setProperties(QDomNode node);
    void LoadGLTextures(QString fileName);
    GLuint makeObject(QDomElement node,GLfloat x=0,GLfloat y=0, GLfloat z=0);
    GLuint makeObjects(QDomNode node);
    void drawQuad(QDomElement e);
     void drawCube(QDomElement e);
     void onclicks(QDomNode e);
    GLfloat* getPoint(QDomElement e);
    GLuint object;
     GLuint *textureIDs;
     GLuint lights;

};

#endif // XMLPARSER_H
